<link rel="stylesheet" type="text/css" th:href="@{/js/plugins/bootstrapvalidator/dist/css/bootstrapValidator.css}" media="all" />
<div class="row">
    <div class="col-xs-12">
        <div class="card">
            <div class="card-header">
                <div class="card-title">
                    <div class="title">编辑角色</div>
                </div>
            </div>
            <div class="card-body">
                <form class="form-horizontal" id="add-ts-role-f" method="post" action="/system/tsRole/ajaxAddTsRole">
                    <div class="form-group">
                        <input type="hidden" th:value="${tsRole.roleId}" name="roleId"/>
                        <label for="roleType" class="col-sm-2 control-label text-left required">角色类型</label>
                        <div class="col-sm-10" id="roleType">
                            <select class="form-control" name="roleType" disabled="disabled">
                                <option value="1" th:selected="${tsRole.roleType =='1'}">超级管理员</option>
                                <option value="2" th:selected="${tsRole.roleType =='2'}" >管理员</option>
                                <option value="3" th:selected="${tsRole.roleType =='3'}">普通角色</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                            <label for="roleName" class="col-sm-2 control-label text-left">角色名称</label>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" id="roleName" name="roleName" th:value="${tsRole.roleName}"/>
                            </div>
                    </div>
                    <div class="form-inline form-group">
                        <label class="col-sm-2 control-label text-left">上级角色</label>
                        <div class="col-sm-10">
                            <input  type="hidden" id="parentRoleId" class="form-control" disabled="disabled"  name="parentRoleId" th:value="${tsRole.parentRoleId}" />
                            <input type="text" class="form-control" disabled="disabled" id="parentRoleName"
                                   th:value="${tsRole.parentRoleName}" name="parentRoleName" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="roleName" class="col-sm-2 control-label text-left">备注</label>
                        <div class="col-sm-10">
                            <textarea type="text" class="form-control" id="roleDesc" name="roleDesc" th:value="${tsRole.roleDesc}"/>
                        </div>
                    </div>
                    <div class="form-group footer">
                        <div class="row text-center">
                            <button type="submit" class="btn btn-info">
                                <i class="glyphicon glyphicon-edit"></i>保存
                            </button>
                            <button type="button" class="btn btn-default">
                                <i class="glyphicon glyphicon-remove"></i>取消
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>


<!-- 模态对话框 -->
<!-- Modal 开始 -->
<div class="modal fade modal-info" id="shown-role-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">选择父级角色</h4>
            </div>
            <div class="modal-body">
                <table id="shown-role-table" class="table" cellspacing="0" width="100%">
                </table>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-info" id="confirm-role-btn">确定</button>
            </div>
        </div>
    </div>
</div>
<!-- Modal 结束 -->

<!-- 新增角色问题  -->
<script type="text/javascript" th:src="@{/js/plugins/bootstrapvalidator/dist/js/bootstrapValidator.js}"></script>
<script type="text/javascript" th:src="@{/js/plugins/bootstrapvalidator/dist/js/language/zh_CN.js}"></script>
<script type="text/javascript" th:src="@{/js/custom/module/tsystem/addTsRole.js}"></script>